{
 "metadata": {
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.5"
  },
  "orig_nbformat": 2,
  "kernelspec": {
   "name": "python3",
   "display_name": "Python 3.8.5 64-bit ('base': conda)",
   "metadata": {
    "interpreter": {
     "hash": "6cd6e2203b621035efd3b4ac9716079b52ce7fc5622f6651a3ae71459e0d54ce"
    }
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2,
 "cells": [
  {
   "source": [
    "能实现的量子门\n",
    "$$U_{i,j}=e^{-iJ_{i,j}t(X_iX_j+Y_iY_j)}$$\n",
    "需要的量子门$G$可通过如下变换得到\n",
    "$$G_{i,j}=XU_{i,j}XU_{i,j}=e^{-2iJ_{i,j}tX_iX_j}$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "对于图$M=\\{(i,j):a_{i,j},\\dots\\}$，由$m$个节点构成，两两之间的权重为$a_{i,j}$，选择合适的时间$t$，使得\n",
    "$$G_{i,j}=G_{i,j}(\\gamma)=e^{-i\\gamma a_{i,j}X_iX_j},t=\\frac{\\gamma a_{i,j}}{2J_{i,j}}$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "计算由图得到的哈密顿量\n",
    "$$C=\\sum_{(i,j)}a_{i,j}X_iX_j$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "QAOA算法中，取如下两个算赋，\n",
    "$$U_C(\\gamma)=e^{-i\\gamma C}=\\Pi_{(i,j)}{G_{i,j}(\\gamma)}$$\n",
    "$$U_B(\\beta)=e^{-i\\beta B}=\\Pi_m{e^{-i\\beta Z_m}}, B=\\sum_m Z_m$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "将上面两个算赋作用在初态上$p$次，\n",
    "$$\\left|\\gamma,\\beta\\right>=U_B(\\beta_p)U_C(\\gamma_p)\\dots U_B(\\beta_1)U_C(\\gamma_1)\\left|0\\right>^{\\oplus n}$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "source": [
    "对于给定$p$，能求出如下量的最小值，以及对应的参数。\n",
    "$$\\left<C\\right>=\\left<\\gamma,\\beta\\right|C\\left|\\gamma,\\beta\\right>$$"
   ],
   "cell_type": "markdown",
   "metadata": {}
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import qutip as qt\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "from scipy.optimize import minimize\n",
    "import pandas as pd\n",
    "paulis={'X': qt.sigmax, 'Y':qt.sigmay, 'Z':qt.sigmaz}\n",
    "iop=pd.read_csv('iop.csv',sep=' ')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_coupling(graph,iop):\n",
    "    J={}\n",
    "    for (q1,q2),_ in graph.items():\n",
    "        J[(q1,q2)]=abs(iop['g_j'][q1+1]*iop['g_j'][q2+1]/(iop['w_j'][q1+1]-iop['w_j'][q2+1]))/1e3\n",
    "    return J"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_graph_max_node(graph):\n",
    "    # 得到对图进行模拟需要的比特数目\n",
    "    return max([max(i) for i in graph])+1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "def place(pois,n,base_gate='X'):\n",
    "    # 在n比特的pois位置上作用basic_gate\n",
    "    g=[qt.identity(2) for i in range(n)]\n",
    "    for i in pois:\n",
    "        g[i]=paulis[base_gate]()\n",
    "    return qt.tensor(g)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_C(graph,base_gate='X'):\n",
    "    n=get_graph_max_node(graph)\n",
    "    res=0\n",
    "    for node,w in graph.items():\n",
    "        res+=place(node,n,base_gate)*w\n",
    "    return res\n",
    "def build_B(graph,base_gate='Z'):\n",
    "    n=get_graph_max_node(graph)\n",
    "    B=0\n",
    "    for i in range(n):\n",
    "        B+=place([i],n,base_gate)\n",
    "    return B"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_U_C(gamma,C):\n",
    "    return (-1j*gamma*C).expm()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_U_B(beta,B):\n",
    "    return (-1j*beta*B).expm()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "def build_U_total(para,C,B):\n",
    "    U=1\n",
    "    for index,val in enumerate(para):\n",
    "        if index%2==0:\n",
    "            U=build_U_C(val,C)*U\n",
    "        else:\n",
    "            U=build_U_B(val,B)*U\n",
    "    return U"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "def calc_exptation(C,U_total,init_state):\n",
    "    return qt.expect(U_total.dag()*C*U_total,init_state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "def show_amp(state):\n",
    "    amp = np.diag(state.dot(np.conj(state.T)))\n",
    "    n_qubits = int(np.log2(len(amp)))\n",
    "    labels = [bin(i)[2:].zfill(n_qubits) for i in range(len(amp))]\n",
    "    plt.bar(labels, amp)\n",
    "    plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def find_min(para, C, B, init_state):\n",
    "    U_total=build_U_total(para,C,B)\n",
    "    eng=calc_exptation(C,U_total,init_state)\n",
    "    return eng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "a=0.1\n",
    "graph={(0,1):1*a,(1,2):1*a,(2,3):1*a,(0,3):1*a}\n",
    "J=get_coupling(graph,iop)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stderr",
     "text": [
      "<ipython-input-13-2dbdf7502ea9>:2: DeprecationWarning: Importing functions/classes of the qip submodule directly from the namespace qutip is deprecated. Please import them from the submodule instead, e.g.\nfrom qutip.qip.operations import cnot\nfrom qutip.qip.circuit import QubitCircuit\n\n  hn=qt.hadamard_transform(n)\n"
     ]
    }
   ],
   "source": [
    "n=get_graph_max_node(graph)\n",
    "hn=qt.hadamard_transform(n)\n",
    "init_state=qt.tensor([qt.basis(2,0) for i in range(n)])\n",
    "C=build_C(graph)\n",
    "B=build_B(graph)\n",
    "para=np.random.normal(size=(2,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "[ 0.04147674  0.0129147  -0.05728973 -0.12037242]\n",
      "[ 0.02869258  0.02144712 -0.07346131 -0.09273207]\n",
      "[ 0.02954194  0.02805569 -0.07666998 -0.10238366]\n",
      "[ 0.02905124  0.04726781 -0.09027317 -0.11412573]\n",
      "[ 0.03197886  0.09051862 -0.12322642 -0.12773472]\n",
      "[ 0.03887369  0.10112881 -0.13627967 -0.12386423]\n",
      "[ 0.0534911   0.10114148 -0.15727788 -0.11944663]\n",
      "[ 0.08165658  0.09599991 -0.19685212 -0.11633964]\n",
      "[ 0.13758603  0.0844717  -0.27240965 -0.11588182]\n",
      "[ 0.17783526  0.0946064  -0.33114643 -0.12419622]\n",
      "[ 0.18488287  0.10187815 -0.34322002 -0.12746605]\n",
      "[ 0.20703561  0.1112253  -0.37495015 -0.13225073]\n",
      "[ 0.21183841  0.10866914 -0.37839132 -0.13124517]\n",
      "[ 0.22536298  0.11010144 -0.39411937 -0.13205432]\n",
      "[ 0.23488047  0.11175996 -0.40516695 -0.13284705]\n",
      "[ 0.23658923  0.11187342 -0.40652146 -0.13291833]\n",
      "[ 0.23831683  0.11184549 -0.40690271 -0.13296779]\n",
      "[ 0.24028121  0.11164113 -0.40599063 -0.13300798]\n",
      "[ 0.33019584  0.09670827 -0.32166292 -0.13423746]\n",
      "[ 0.33366417  0.09603657 -0.31773511 -0.13423489]\n",
      "[ 0.36279269  0.08866184 -0.27022908 -0.13278863]\n",
      "[ 0.37668036  0.08415394 -0.23985234 -0.13134084]\n",
      "[ 0.37809598  0.08206341 -0.21959244 -0.12981339]\n",
      "[ 0.37071322  0.08087195 -0.19852842 -0.1274678 ]\n",
      "[ 0.35485227  0.07910634 -0.16371475 -0.12218468]\n",
      "[ 0.35815056  0.0784878  -0.16142258 -0.12050363]\n",
      "[ 0.36862418  0.07541609 -0.15522221 -0.11704971]\n",
      "[ 0.46597739  0.04957127 -0.15419504 -0.08829667]\n",
      "[ 0.57809636  0.03618525 -0.23726403 -0.06856691]\n",
      "[ 0.69413719  0.03925753 -0.30623895 -0.06931468]\n",
      "[ 0.83318633  0.03516419 -0.39228519 -0.06876665]\n",
      "[ 0.81542048  0.03990612 -0.41511568 -0.07500085]\n",
      "[ 0.76833819  0.04029592 -0.37716808 -0.08108327]\n",
      "[ 0.78507546  0.03908614 -0.39260129 -0.07829558]\n",
      "[ 0.78510742  0.03927133 -0.39261537 -0.07852256]\n",
      "[ 0.78530015  0.03927046 -0.39265724 -0.078538  ]\n",
      "[ 0.7853963   0.03926994 -0.39269796 -0.07853994]\n",
      "Optimization terminated successfully.\n",
      "         Current function value: -0.400000\n",
      "         Iterations: 37\n",
      "         Function evaluations: 255\n",
      "         Gradient evaluations: 51\n"
     ]
    }
   ],
   "source": [
    "res=minimize(find_min, para, args=(C,B,init_state),method='bfgs',options={'disp':True},callback=lambda x: print(x*a))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stderr",
     "text": [
      "/home/xuxs/anaconda3/lib/python3.8/site-packages/numpy/core/_asarray.py:85: ComplexWarning: Casting complex values to real discards the imaginary part\n  return array(a, dtype, copy=False, order=order)\n"
     ]
    },
    {
     "output_type": "display_data",
     "data": {
      "text/plain": "<Figure size 432x288 with 1 Axes>",
      "image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n<!-- Created with matplotlib (https://matplotlib.org/) -->\n<svg height=\"248.518125pt\" version=\"1.1\" viewBox=\"0 0 372.103125 248.518125\" width=\"372.103125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n <metadata>\n  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n   <cc:Work>\n    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n    <dc:date>2021-03-16T14:31:05.531292</dc:date>\n    <dc:format>image/svg+xml</dc:format>\n    <dc:creator>\n     <cc:Agent>\n      <dc:title>Matplotlib v3.3.2, https://matplotlib.org/</dc:title>\n     </cc:Agent>\n    </dc:creator>\n   </cc:Work>\n  </rdf:RDF>\n </metadata>\n <defs>\n  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n </defs>\n <g id=\"figure_1\">\n  <g id=\"patch_1\">\n   <path d=\"M 0 248.518125 \nL 372.103125 248.518125 \nL 372.103125 0 \nL 0 0 \nz\n\" style=\"fill:none;\"/>\n  </g>\n  <g id=\"axes_1\">\n   <g id=\"patch_2\">\n    <path d=\"M 30.103125 224.64 \nL 364.903125 224.64 \nL 364.903125 7.2 \nL 30.103125 7.2 \nz\n\" style=\"fill:#ffffff;\"/>\n   </g>\n   <g id=\"patch_3\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 45.321307 224.64 \nL 60.732124 224.64 \nL 60.732124 224.64 \nL 45.321307 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_4\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 64.584828 224.64 \nL 79.995645 224.64 \nL 79.995645 224.64 \nL 64.584828 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_5\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 83.848349 224.64 \nL 99.259166 224.64 \nL 99.259166 224.64 \nL 83.848349 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_6\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 103.111871 224.64 \nL 118.522688 224.64 \nL 118.522688 224.64 \nL 103.111871 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_7\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 122.375392 224.64 \nL 137.786209 224.64 \nL 137.786209 224.64 \nL 122.375392 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_8\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 141.638913 224.64 \nL 157.04973 224.64 \nL 157.04973 17.554286 \nL 141.638913 17.554286 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_9\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 160.902435 224.64 \nL 176.313252 224.64 \nL 176.313252 224.64 \nL 160.902435 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_10\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 180.165956 224.64 \nL 195.576773 224.64 \nL 195.576773 224.64 \nL 180.165956 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_11\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 199.429477 224.64 \nL 214.840294 224.64 \nL 214.840294 224.64 \nL 199.429477 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_12\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 218.692998 224.64 \nL 234.103815 224.64 \nL 234.103815 224.64 \nL 218.692998 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_13\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 237.95652 224.64 \nL 253.367337 224.64 \nL 253.367337 17.554286 \nL 237.95652 17.554286 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_14\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 257.220041 224.64 \nL 272.630858 224.64 \nL 272.630858 224.64 \nL 257.220041 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_15\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 276.483562 224.64 \nL 291.894379 224.64 \nL 291.894379 224.64 \nL 276.483562 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_16\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 295.747084 224.64 \nL 311.157901 224.64 \nL 311.157901 224.64 \nL 295.747084 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_17\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 315.010605 224.64 \nL 330.421422 224.64 \nL 330.421422 224.64 \nL 315.010605 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"patch_18\">\n    <path clip-path=\"url(#pe2ac373dea)\" d=\"M 334.274126 224.64 \nL 349.684943 224.64 \nL 349.684943 224.64 \nL 334.274126 224.64 \nz\n\" style=\"fill:#1f77b4;\"/>\n   </g>\n   <g id=\"matplotlib.axis_1\">\n    <g id=\"xtick_1\">\n     <g id=\"line2d_1\">\n      <defs>\n       <path d=\"M 0 0 \nL 0 3.5 \n\" id=\"m1fccc384aa\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"53.026715\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_1\">\n      <!-- 0000 -->\n      <g transform=\"translate(40.301715 239.238437)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 31.78125 66.40625 \nQ 24.171875 66.40625 20.328125 58.90625 \nQ 16.5 51.421875 16.5 36.375 \nQ 16.5 21.390625 20.328125 13.890625 \nQ 24.171875 6.390625 31.78125 6.390625 \nQ 39.453125 6.390625 43.28125 13.890625 \nQ 47.125 21.390625 47.125 36.375 \nQ 47.125 51.421875 43.28125 58.90625 \nQ 39.453125 66.40625 31.78125 66.40625 \nz\nM 31.78125 74.21875 \nQ 44.046875 74.21875 50.515625 64.515625 \nQ 56.984375 54.828125 56.984375 36.375 \nQ 56.984375 17.96875 50.515625 8.265625 \nQ 44.046875 -1.421875 31.78125 -1.421875 \nQ 19.53125 -1.421875 13.0625 8.265625 \nQ 6.59375 17.96875 6.59375 36.375 \nQ 6.59375 54.828125 13.0625 64.515625 \nQ 19.53125 74.21875 31.78125 74.21875 \nz\n\" id=\"DejaVuSans-48\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_2\">\n     <g id=\"line2d_2\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"72.290237\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_2\">\n      <!-- 0001 -->\n      <g transform=\"translate(59.565237 239.238437)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 12.40625 8.296875 \nL 28.515625 8.296875 \nL 28.515625 63.921875 \nL 10.984375 60.40625 \nL 10.984375 69.390625 \nL 28.421875 72.90625 \nL 38.28125 72.90625 \nL 38.28125 8.296875 \nL 54.390625 8.296875 \nL 54.390625 0 \nL 12.40625 0 \nz\n\" id=\"DejaVuSans-49\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_3\">\n     <g id=\"line2d_3\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"91.553758\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_3\">\n      <!-- 0010 -->\n      <g transform=\"translate(78.828758 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_4\">\n     <g id=\"line2d_4\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"110.817279\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_4\">\n      <!-- 0011 -->\n      <g transform=\"translate(98.092279 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_5\">\n     <g id=\"line2d_5\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"130.0808\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_5\">\n      <!-- 0100 -->\n      <g transform=\"translate(117.3558 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_6\">\n     <g id=\"line2d_6\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"149.344322\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_6\">\n      <!-- 0101 -->\n      <g transform=\"translate(136.619322 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_7\">\n     <g id=\"line2d_7\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"168.607843\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_7\">\n      <!-- 0110 -->\n      <g transform=\"translate(155.882843 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_8\">\n     <g id=\"line2d_8\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"187.871364\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_8\">\n      <!-- 0111 -->\n      <g transform=\"translate(175.146364 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_9\">\n     <g id=\"line2d_9\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"207.134886\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_9\">\n      <!-- 1000 -->\n      <g transform=\"translate(194.409886 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_10\">\n     <g id=\"line2d_10\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"226.398407\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_10\">\n      <!-- 1001 -->\n      <g transform=\"translate(213.673407 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_11\">\n     <g id=\"line2d_11\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"245.661928\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_11\">\n      <!-- 1010 -->\n      <g transform=\"translate(232.936928 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_12\">\n     <g id=\"line2d_12\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"264.92545\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_12\">\n      <!-- 1011 -->\n      <g transform=\"translate(252.20045 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_13\">\n     <g id=\"line2d_13\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"284.188971\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_13\">\n      <!-- 1100 -->\n      <g transform=\"translate(271.463971 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_14\">\n     <g id=\"line2d_14\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"303.452492\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_14\">\n      <!-- 1101 -->\n      <g transform=\"translate(290.727492 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_15\">\n     <g id=\"line2d_15\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"322.716013\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_15\">\n      <!-- 1110 -->\n      <g transform=\"translate(309.991013 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"xtick_16\">\n     <g id=\"line2d_16\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"341.979535\" xlink:href=\"#m1fccc384aa\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_16\">\n      <!-- 1111 -->\n      <g transform=\"translate(329.254535 239.238437)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"127.246094\" xlink:href=\"#DejaVuSans-49\"/>\n       <use x=\"190.869141\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"matplotlib.axis_2\">\n    <g id=\"ytick_1\">\n     <g id=\"line2d_17\">\n      <defs>\n       <path d=\"M 0 0 \nL -3.5 0 \n\" id=\"m06b53689d7\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n      </defs>\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"224.64\"/>\n      </g>\n     </g>\n     <g id=\"text_17\">\n      <!-- 0.0 -->\n      <g transform=\"translate(7.2 228.439219)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 10.6875 12.40625 \nL 21 12.40625 \nL 21 0 \nL 10.6875 0 \nz\n\" id=\"DejaVuSans-46\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-48\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_2\">\n     <g id=\"line2d_18\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"183.222857\"/>\n      </g>\n     </g>\n     <g id=\"text_18\">\n      <!-- 0.1 -->\n      <g transform=\"translate(7.2 187.022076)scale(0.1 -0.1)\">\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-49\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_3\">\n     <g id=\"line2d_19\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"141.805714\"/>\n      </g>\n     </g>\n     <g id=\"text_19\">\n      <!-- 0.2 -->\n      <g transform=\"translate(7.2 145.604933)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 19.1875 8.296875 \nL 53.609375 8.296875 \nL 53.609375 0 \nL 7.328125 0 \nL 7.328125 8.296875 \nQ 12.9375 14.109375 22.625 23.890625 \nQ 32.328125 33.6875 34.8125 36.53125 \nQ 39.546875 41.84375 41.421875 45.53125 \nQ 43.3125 49.21875 43.3125 52.78125 \nQ 43.3125 58.59375 39.234375 62.25 \nQ 35.15625 65.921875 28.609375 65.921875 \nQ 23.96875 65.921875 18.8125 64.3125 \nQ 13.671875 62.703125 7.8125 59.421875 \nL 7.8125 69.390625 \nQ 13.765625 71.78125 18.9375 73 \nQ 24.125 74.21875 28.421875 74.21875 \nQ 39.75 74.21875 46.484375 68.546875 \nQ 53.21875 62.890625 53.21875 53.421875 \nQ 53.21875 48.921875 51.53125 44.890625 \nQ 49.859375 40.875 45.40625 35.40625 \nQ 44.1875 33.984375 37.640625 27.21875 \nQ 31.109375 20.453125 19.1875 8.296875 \nz\n\" id=\"DejaVuSans-50\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-50\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_4\">\n     <g id=\"line2d_20\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"100.388571\"/>\n      </g>\n     </g>\n     <g id=\"text_20\">\n      <!-- 0.3 -->\n      <g transform=\"translate(7.2 104.18779)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 40.578125 39.3125 \nQ 47.65625 37.796875 51.625 33 \nQ 55.609375 28.21875 55.609375 21.1875 \nQ 55.609375 10.40625 48.1875 4.484375 \nQ 40.765625 -1.421875 27.09375 -1.421875 \nQ 22.515625 -1.421875 17.65625 -0.515625 \nQ 12.796875 0.390625 7.625 2.203125 \nL 7.625 11.71875 \nQ 11.71875 9.328125 16.59375 8.109375 \nQ 21.484375 6.890625 26.8125 6.890625 \nQ 36.078125 6.890625 40.9375 10.546875 \nQ 45.796875 14.203125 45.796875 21.1875 \nQ 45.796875 27.640625 41.28125 31.265625 \nQ 36.765625 34.90625 28.71875 34.90625 \nL 20.21875 34.90625 \nL 20.21875 43.015625 \nL 29.109375 43.015625 \nQ 36.375 43.015625 40.234375 45.921875 \nQ 44.09375 48.828125 44.09375 54.296875 \nQ 44.09375 59.90625 40.109375 62.90625 \nQ 36.140625 65.921875 28.71875 65.921875 \nQ 24.65625 65.921875 20.015625 65.03125 \nQ 15.375 64.15625 9.8125 62.3125 \nL 9.8125 71.09375 \nQ 15.4375 72.65625 20.34375 73.4375 \nQ 25.25 74.21875 29.59375 74.21875 \nQ 40.828125 74.21875 47.359375 69.109375 \nQ 53.90625 64.015625 53.90625 55.328125 \nQ 53.90625 49.265625 50.4375 45.09375 \nQ 46.96875 40.921875 40.578125 39.3125 \nz\n\" id=\"DejaVuSans-51\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-51\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_5\">\n     <g id=\"line2d_21\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"58.971429\"/>\n      </g>\n     </g>\n     <g id=\"text_21\">\n      <!-- 0.4 -->\n      <g transform=\"translate(7.2 62.770647)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 37.796875 64.3125 \nL 12.890625 25.390625 \nL 37.796875 25.390625 \nz\nM 35.203125 72.90625 \nL 47.609375 72.90625 \nL 47.609375 25.390625 \nL 58.015625 25.390625 \nL 58.015625 17.1875 \nL 47.609375 17.1875 \nL 47.609375 0 \nL 37.796875 0 \nL 37.796875 17.1875 \nL 4.890625 17.1875 \nL 4.890625 26.703125 \nz\n\" id=\"DejaVuSans-52\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-52\"/>\n      </g>\n     </g>\n    </g>\n    <g id=\"ytick_6\">\n     <g id=\"line2d_22\">\n      <g>\n       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"30.103125\" xlink:href=\"#m06b53689d7\" y=\"17.554286\"/>\n      </g>\n     </g>\n     <g id=\"text_22\">\n      <!-- 0.5 -->\n      <g transform=\"translate(7.2 21.353504)scale(0.1 -0.1)\">\n       <defs>\n        <path d=\"M 10.796875 72.90625 \nL 49.515625 72.90625 \nL 49.515625 64.59375 \nL 19.828125 64.59375 \nL 19.828125 46.734375 \nQ 21.96875 47.46875 24.109375 47.828125 \nQ 26.265625 48.1875 28.421875 48.1875 \nQ 40.625 48.1875 47.75 41.5 \nQ 54.890625 34.8125 54.890625 23.390625 \nQ 54.890625 11.625 47.5625 5.09375 \nQ 40.234375 -1.421875 26.90625 -1.421875 \nQ 22.3125 -1.421875 17.546875 -0.640625 \nQ 12.796875 0.140625 7.71875 1.703125 \nL 7.71875 11.625 \nQ 12.109375 9.234375 16.796875 8.0625 \nQ 21.484375 6.890625 26.703125 6.890625 \nQ 35.15625 6.890625 40.078125 11.328125 \nQ 45.015625 15.765625 45.015625 23.390625 \nQ 45.015625 31 40.078125 35.4375 \nQ 35.15625 39.890625 26.703125 39.890625 \nQ 22.75 39.890625 18.8125 39.015625 \nQ 14.890625 38.140625 10.796875 36.28125 \nz\n\" id=\"DejaVuSans-53\"/>\n       </defs>\n       <use xlink:href=\"#DejaVuSans-48\"/>\n       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-46\"/>\n       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-53\"/>\n      </g>\n     </g>\n    </g>\n   </g>\n   <g id=\"patch_19\">\n    <path d=\"M 30.103125 224.64 \nL 30.103125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_20\">\n    <path d=\"M 364.903125 224.64 \nL 364.903125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_21\">\n    <path d=\"M 30.103125 224.64 \nL 364.903125 224.64 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n   <g id=\"patch_22\">\n    <path d=\"M 30.103125 7.2 \nL 364.903125 7.2 \n\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n   </g>\n  </g>\n </g>\n <defs>\n  <clipPath id=\"pe2ac373dea\">\n   <rect height=\"217.44\" width=\"334.8\" x=\"30.103125\" y=\"7.2\"/>\n  </clipPath>\n </defs>\n</svg>\n",
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAOyUlEQVR4nO3df6jd913H8ed7N8v+GJS55s6NJF0yDdYgHdRrVmWg/lFMp5AWJ6aKq7oRMojiH4NFBkMYBdu/RBsXggTnX0FQ68VFgxRFZY7lVrZiqpnXtJJr6nrX2naZtWmat3+cb7fj6fnxPd98b5P77vMBl5zv5/s57/O+n3z7ut9+7znfRGYiSdr83najG5Ak9cNAl6QiDHRJKsJAl6QiDHRJKmLLjXrhbdu25a5du27Uy0vSpvT4449/MzMXx+27YYG+a9cuVlZWbtTLS9KmFBH/MWmfl1wkqQgDXZKKMNAlqQgDXZKKMNAlqQgDXZKKaBXoEbE/Is5HxGpEHB2z/yci4sWI+Grz9dn+W5UkTTPzfegRsQAcA+4G1oCzEbGcmU+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99qboMB8K6R53Q5zubpa6yOffWty5rNVavPZjv2deNsxG9aN+KLwa0Fvs7gN9mfacZuBR5j8Farx4B3D83/TDP3PM1vpZvxJQbv/rgCvHidtR5m8BP8GoMzw+db1nu6mXu5ef7e6+htUq2HGdy+Mxm83eqxZvy+Zt4rwDeAM9exZl1qTVuzafXmXbMutR5m8K6I1y/bvAR8fMb6T1uzF5q1f615na61uvQ1bb3m7Wvaeq01Pb02Uq/rcTaut67H2bg163qMzdvXrDW71vz5W33mpB/9l6QiNsslF0nSDAa6JBVhoEtSEQa6JBVhoEtSEQa6JBVhoEtSEf8HoFKYtmj2sZcAAAAASUVORK5CYII=\n"
     },
     "metadata": {
      "needs_background": "light"
     }
    }
   ],
   "source": [
    "opti_para=res.x\n",
    "U_total=build_U_total(opti_para,C,B)\n",
    "final_state = hn*U_total*init_state\n",
    "final_state=final_state.data.toarray()\n",
    "show_amp(final_state)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "output_type": "execute_result",
     "data": {
      "text/plain": [
       "array([-7.85397856,  3.92697945])"
      ]
     },
     "metadata": {},
     "execution_count": 16
    }
   ],
   "source": [
    "opti_para[::2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 219,
   "metadata": {},
   "outputs": [
    {
     "output_type": "stream",
     "name": "stdout",
     "text": [
      "For layer 1\nTime for G_(0,1):0.14084333011317415\nTime for G_(1,2):0.15286928565351357\nTime for G_(2,3):0.1309260014863419\nTime for G_(0,3):0.16179062806394262\nFor layer 2\nTime for G_(0,1):0.1741583999929331\nTime for G_(1,2):0.18902897408123887\nTime for G_(2,3):0.16189522725720368\nTime for G_(0,3):0.20006057010173148\n"
     ]
    }
   ],
   "source": [
    "gamma = opti_para[::2]\n",
    "beta = opti_para[1::2]\n",
    "for p in range(len(gamma)):\n",
    "    print(\"For layer {}\".format(p+1))\n",
    "    for n,v in J.items():\n",
    "        print('Time for G_({},{}):{}'.format(n[0],n[1],gamma[p]*graph[n]/2/v))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ]
}